<?php

/**
 * +----------------------------------------------------------------------
 * | TickyPHP [ This is a freeware ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2015 All rights reserved.
 * +----------------------------------------------------------------------
 * | Author: 罗敏贵 <e-mail:minguiluo@163.com> <QQ:271391233>
 * +----------------------------------------------------------------------
 * | SVN: $Id: Model.php 81285 2019-01-14 09:22:24 luomingui $
 * +----------------------------------------------------------------------
 * | 文件功能：对应的表名:tky_model
 * +----------------------------------------------------------------------
 */

namespace application\admin\controller;

use ticky\request;

class sitemodel extends base {

    // 首页
    public function index() {
        $search = $this->search_frm();
        $ret = db('model')->where($search['sql'])->order('modelid desc')->newpage();
        $this->assign('page', $ret['page']);
        $this->assign('items', $ret['items']);
        $this->assign('search', $search['arr']);
        $this->display('sitemodel/index');
    }

    //查询条件
    private function search_frm() {
        $search = request::get('search', []);
        $where = "1=1 and type = '0' ";

        return [
            'arr' => $search,
            'sql' => $where
        ];
    }

}
